1) Field of the Invention
The present invention relates to a method and an apparatus for controlling a recording medium and a computer product for performing a read-access or a write-access of a recording medium in response to an access request from a higher-level apparatus, detecting a read error that occurs during the read-access, and performing a replacement processing.
2) Description of the Related Art
A conventional disk controlling apparatus, known as a disk array or a redundant array of inexpensive disks (RAID), uses a plurality of disks to obtain high performance and high reliability when executing. parallel operations. In this type of disk controlling apparatus, when a read error has occurred in response to a read access of the disk, the data to be extracted is reconstructed from data stored in another disk. In addition, the disk controlling apparatus determines whether the read error is caused by a fundamental medium failure, and performs replacement processing accordingly.
More specifically, when a read error occurs, the disk controlling apparatus retries to read-access a sector where the error occurred. When data is successfully extracted in the retry, the apparatus determines the error to be a sporadic read error, and transfers the extracted data in the usual manner to the higher-level apparatus (host computer). On the other hand, when the retry results in another read error, the apparatus determines that the read error is caused by a fundamental medium failure, reconstructs the data to be extracted from another disk, allocates a new sector to replace the one where the error occurred, and writes the reconstructed data in the replacement sector (see, for example, Japanese Patent Application Laid-open No. H10-247133).
However, the conventional technology described above cannot accurately determine what caused the read error. When replacement processing is not carried out where it is needed, the result is poor performance and double malfunctions, and when replacement processing is carried out in locations where it is not needed, the replacement region is wasted.
Namely, in the conventional technology described above, the decision of whether replacement processing is required is made based on whether another read error is generated in response to a retry at the location where the first error occurred. However, when the read error is the result of a minor medium failure rather than a serious one, a retry may not always produce another read error, so that the apparatus determines that the read error is sporadic and does not perform replacement processing. In this case, even when the medium failure is a minor one, frequent read errors will subsequently occur in the same location. Retrying every time there is a read error will reduce the performance of the disk controlling apparatus, and ignoring this type of medium failure by not performing replacement processing may lead to double malfunctions.
On the other hand, a read error sometimes occurs sporadically in response to a retry, even when there is no failure whatsoever in the medium. The conventional technology described above performs replacement processing even for these read errors. In this case, since there is no medium failure where the read error occurred, and therefore no need for replacement, the replacement region is wastefully consumed.
Data is sometimes lost due to thermal demagnetization caused by the impact when the head of the disk contacts the medium. In the conventional technology described above, when a read error is caused by thermal demagnetization, retries will always result in read errors, so that the apparatus determines that there is a fundamental medium failure and performs replacement processing. In this case, since there is no medium failure where the read error occurred, it being possible to extract the data normally by rewriting it, the replacement region is wastefully consumed.